package servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import logic.Agency;
import manager.AgencyManager;

import dataAccess.DBManager;
import dataType.AgencyData;
import dataType.AgencyDataWS;
import dataType.IMMResponseDataType;
import dataType.TicketData;
import exception.MyException;

/**
 * Servlet implementation class prueba
 */
public class prueba extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public prueba() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		PrintWriter pw = response.getWriter();
		Agency a = new Agency();
		boolean resp= false;
		try {
			resp = a.autentication(1, "user","pass");
		} catch (MyException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		if (resp == true){
			pw.write("ok");
			pw.close();			
			
		}else{
			pw.write("cuackkkkkkk");
			pw.close();			
			
		}		

	}

}
